# DhlpWeb单元测试类
import unittest
from apps.dhlp.dhlp_web import DhlpWeb

class TDhlpWeb(unittest.TestCase):
    # python -m unittest -v uts.apps.dhlp.t_dhlp_web.TDhlpWeb.test_get_gt_labels
    def test_get_gt_labels(self):
        ds_fn = 'work/datasets/dhlp/v1/ds.txt'
        gt_label = DhlpWeb.get_gt_labels(ds_fn)
        for k, v in gt_label.items():
            print(f'### {k}:={v["rid"]}+{v["cls"]}')

    # python -m unittest -v uts.apps.dhlp.t_dhlp_web.TDhlpWeb.test_get_curr_unlabel
    def test_get_curr_unlabel(self):
        did, rid = DhlpWeb.get_curr_unlabel(DhlpWeb.labeling_prog_fn, DhlpWeb.labeling_progs)
        print(f'### {did}, {rid};')
        print(f'?????? {DhlpWeb.labeling_progs};')

    # python -m unittest -v uts.apps.dhlp.t_dhlp_web.TDhlpWeb.test_get_rec_frms_raw
    def test_get_rec_frms_raw(self):
        did = 'F56AC57A1181CD'
        rid = '16728'
        rec_frms = DhlpWeb.get_rec_frms_raw(did, rid)
        print(f'记录帧内容：\n{rec_frms};')